package com.qmrz.nb.project.alpubdb.controller;

import com.qmrz.nb.project.alpubdb.entity.Blog;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * WEB 视图层
 * create by liang on 2022-01-04.
 */
@Controller
@Log4j2
public class IndexController {

    @RequestMapping("/")
    public String index() {
        return "toDoc";
    }

    @RequestMapping("/test")
    public String test(Model model) {

        model.addAttribute("msg", "标准变量表达式");

        Blog blog = new Blog();
        blog.setId(1);
        blog.setName("yixin");
        blog.setPwd("123");

        model.addAttribute("blog", blog);
        return "test";

    }
}




